﻿package h.ku.eval{	import h.ku.lang.hkuObject;	public class ControlStatementEval extends FunctionEval	{		public var statement:String				public function ControlStatementEval(s:String)		{			this.statement = s			super("",[])		}				public override function execute(c:FunctionEval, topLevel:Boolean, caller:*, container:FunctionEval, callback:Function=null, doReturn:Boolean=true):*		{			var nc:FunctionEval = c			var lc:FunctionEval = nc			var found:Boolean = false			while(true){				if(nc.isLoop)				{					found = true					break				}				nc = nc.callingEval				if(nc == null || nc == lc){					break				}				lc = nc			}			switch(statement)			{				case "continue":					if(found) AbstractLoopEval(nc).doContinue()					break				case "break":					if(found) AbstractLoopEval(nc).doBreak()					break			}		}	}}